/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DBConnection;

/**
 *
 * @author User
 */
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBConnectionImpl extends DBConnector {

    private String driver, url, username, password;
    public Connection conn;

    public DBConnectionImpl( String driver, String url, String username, String password)
    {
        this.driver = driver;
        this.url = url;
        this.username = username;
        this.password = password;
    }

    @Override
    public Connection getConnection()
    {
        try{
            Class.forName(driver);
            conn = DriverManager.getConnection(url, username, password);

            return conn;
            
        }
        catch(SQLException e)
        {
        }
        catch(ClassNotFoundException e)
        {
        }
        return null;
    }

}